home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
utility
/
read707.zip
/
READY.DOC
< prev
next >
Wrap
Text File
|
1997-07-31
|
31KB
|
638 lines
READY.DOC 1 Jul 31, 1997
WIN95 AND WINNT NOTICE: As with most DOS-based utilities, this program doesn't
understand the weird subdirectories, long filenames, invalid characters that
are possible under Windows 95 and Windows/NT. Both operating systems alias
long filenames into names like MYFILE~1.TXT and you will need to specify the
aliased versions of file names to process them. Under some file structure
systems in NT, the program may not work at all.
The READY.EXE program is a text file viewer and offers most of the functions of
the similar READ.EXE program. It is, however, a stripped-down version of READ
and it processes files in a totally different way so it has some different
features.
Features of the READY program:
* Handles files of an unlimited number of lines.
* Handles DOS text files (lines end with CR/LF), Mac text files (lines end
with CR), or Unix text files (lines end with LF).
* Allows text to be blocked and copied or printed.
* Allows a user-specified string after partial or full text is printed.
* Supports 43/50-line mode under EGA and VGA.
* Allows jumping to DOS as well as allowing you to turn off this feature
(useful for public-use terminals).
* Allows case-insensitive text searching within the file.
* Shows a ruler line if desired.
* Shows the file before it has finished loading so you can start reading
sooner.
* Provides the ability to show line numbers on the screen.
* Expands tabs for display.
* Makes a quick determination of the maximum line length and sets it to
either 80, 132, or 255 for processing purposes. This doesn't affect the
actual input file, just the temporary file that the program runs off of.
* Allows lines over the maximum line length to be either truncated, wrapped,
or split. The continuation lines (if any) can be preceded with a user-
specified string or x-number of spaces.
* Allows specified words to be highlighted throughout the text so they can be
identified more easily. (This is different from the typical "Find"
feature.)
* Can Ctrl-PgUp/Ctrl-PgDn among up to 100 files.
* Allows the user to adjust terminal colors.
* To a limited extent and with a fair amount of manual effort, can be used to
write out word processing files as ASCII text.
* The date format shown is based on your country setting.
* Can reroute the output to a disk file or printer and get the automatic
wrapping and such if desired.
* Pressing escape stops the program early.
READY.DOC 2 Jul 31, 1997
READY's advantages over READ:
* It can handle files of unlimited line counts.
* It can be very quick processing files the second time they are viewed.
* It requires less memory than READ requires.
* It provides the ability to show line numbers on the screen.
* Expands tabs for display (READ displays them as little circles).
* Wraps or splits up long lines for display.
* Allows word highlighting throughout a document.
* Allows the user to specify a range of lines to read.
* Allows you to filter out characters as well as providing your own character
translation table.
READY's disadvantages over READ:
* It handles files by rewriting them out to (by default) your C drive. So a
large file will take up considerable disk space.
* Any lines that are wider than the determined maximum line length (80, 132,
or 255) are truncated, wrapped, or split up instead of being able to view
their entire length.
* It does not support some of the special functions that READ handles.
Specifically, forget all of the following (although they could be added if
people really demanded them):
Ctrl-P Printer formfeed
/ Case-sensitive search (only non-sensitive searches work)
#line Skip to a specified line number
-line Move backward x-number of lines
+line Move forward x-number of lines
* It does not provide any mouse support.
* It does not provide any printer setup options (although it does provide
wide and regular printer settings).
However, in many cases, this is a very useful command.
READY.DOC 3 Jul 31, 1997
Temporary file:
The program writes out a random-access file as (by default) C:\READY.TMP. This
file contains one 80-character record for every line in your original file. (If
your line length is specified as 132 or 255 characters, then each record will
be that length instead.) In general, this file will be much larger than your
original file. When the program finishes, by default it deletes the temporary
file.
The process of reading and writing the file can take awhile for large files
although it's fairly quick for small files.
You can retain the temporary file if you'd like and the file can be written to
a networked drive if desired. This makes secondary reads quicker.
If the temporary file is retained, the program is smart enough to compare the
file date and time of the original file with the file stored in the temporary
file. If the original file has been updated or is different from the file
stored in the temporary file, the program will reprocess the source file.
Otherwise, it will just read the temporary file.
For example, if you run the program with this command:
READY J:\EBBNEW\DATA\BULL12.TXT /TJ:\EBBNEW\BULL12.TMP /KEEP
the first time the program is run, it will create the temporary file
(BULL12.TMP) based on BULL12.TXT and then will keep the temporary file. The
next time you (or someone) issues the same command, it will notice that the
BULL12.TXT file hasn't been updated so it will immediately work with the
temporary file. If the source file (BULL12.TXT) gets updated, the program will
notice it's been updated and reprocess the file.
Binary files:
READY provides some features that allow you to read binary files. Binary files
include the standard EXE and COM files but it also includes files which are
stored in a native word processing format, like a WordPerfect or Microsoft Word
file. Once the file is read, you can write it out again using READY and it
will be a *very* roughly formatted version of the original file.
Parameters which are primarily of use when viewing binary files:
/BINARY sets binary processing on
/FILTER replaces non-printable codes with spaces
/INDENT=-n indents just the first line of block (vs /INDENT=n which
indents just the continued lines)
/EOL=str tells program what the end-of-line character is
Keep in mind that most native format files start with all sorts of binary codes
to indicate things like fonts and margins. Within the document, you'll
typically see all sorts of binary codes for margin changes as well as weird
characters which indicate "soft hyphens" and "hard page breaks" and such.
READY.DOC 4 Jul 31, 1997
Needless to say, none of this stuff shows up very well unless you have a
program that can specifically read and convert those files. They definitely
don't work very well under normal text viewers.
READY provides the ability to read a binary file in as blocks of 6000
characters instead of as individual lines. It will then process the blocks as
virtual lines, wrapping them at word boundaries.
Let's do an example. You've got a Microsoft Word for Windows 6.0 file called
RAID.MSW and have no way at all to handle it. It's about 400,000 bytes long.
If you run into a binary file without preparing READY for it, READY will give
you are error about "(Warning... Is this really a text file? Program may
abort...)" and then probably blow up if the file is any more than about 30,000
bytes.
So try READY with "READY RAID.MSW /BINARY". The program should bring it up on
the screen. Scroll to the right and left since /BINARY automatically puts you
into 255-character mode.
You'll see a lot of junk in the front of the file and then some actual lines of
text. The program default is to wrap long lines (/WRAP). It also adds
indenting before the continuation lines which is kind of confusing (the default
is /INDENT=3 when /WRAP takes effect). Ideally, the program would wrap the
lines not based just on the words but on the actual paragraph break characters.
Notice that the Microsoft Word seems to use little musical note symbols at the
ends of paragraphs. This should be your end-of-line indicator. What's the
code? Use "READY /?&H" and look for it. It's a decimal 13 which can be
entered into READY as "\013".
Since you know what code Word uses for ends of paragraphs, you don't need to
see the binary codes any more. Pass in the "/FILTER" parameter to replace them
with spaces.
You also want to see the whole text on the screen so force the program into
80-column mode by specifying "/WIDTH=80".
You want to switch the program so it indents the first line of each line
(paragraph) instead of the continuation lines. This is done with a negative
indent parameter. Pass in "/INDENT=-3" for this.
Now, try READY with "READY RAID.MSW /BINARY /EOL=\013 /FILTER /WIDTH=80
/INDENT=-3".
This changes things considerably. There will probably be a different number of
lines now because the program replaced the binary characters with spaces and
can now wrap in different places. Move around the file and try to find the
actual block that contains real text. Write it out using the line-marking
features (documented later) combined with file copying (Alt-D) or printing
(Alt-P).
One thing to watch out for is that the program may split up words that fall on
the 6000-byte boundaries. As long as you've allowed indentation, you can
quickly scan through the file and watch out for these.
Things like hyphenation, tables, and sometimes quotation marks will all be
stripped by this process. Still, it might be handy.
READY.DOC 5 Jul 31, 1997
Defining Character-Translations (The Filter Table):
READY allows you to translate specified characters as the text is read. This
is especially useful when you're reading something like a Microsoft Word file
and you know that some weird character is *really* supposed to be some other
character.
There is a default character-translation table built into the program which you
can request by passing in the parameter "/FILTER". In this case, all
characters between decimal 32 and 126 as well as decimal 9 (the tab) keep their
original values and everything else get translated as a space. This leaves you
with the following characters:
(tab) (space) !"#$%&'()*+,-./
0123456789 :;<=>?@
ABCDEFGHIJKLMNOPQRSTUVWXYZ [\]^_`
abcdefghijklmnopqrstuvwxyz {|}~
Alternatively, you can create your own filter file and invoke it by specifying
the "/FILTER=filename" parameter. The filters can be in your standard *.INI
file (for example, READ.INI) if desired. If it becomes large, however, you
might want to move it to its own filename. A sample READFILT.INI file is
provided. You can modify this file or create your own.
The filter table is an ASCII text file which consists of a series of lines in
the following format:
inchar = outchar
where "inchar" is the character to change from and "outstr" is what to change
the character to. Both portions can consist of regular non-space ASCII text
characters (like "A" or "z") as well as hexadecimal values (in the form &Hxx)
or decimal values (in the form \nnn). Both sides can reference a single
character (exactly one character is always translated into exactly one
character). You cannot use a space or equal sign in either "inchar" or
"outchar"; use the hexadecimal or decimal representations instead. The table
does not have to be in any specified order. Lines can end with "/*" followed
by a comment if you want.
Hexadecimal and decimal equivalents are explained in BRUCEHEX.DOC.
Examples:
a = A /* Translate lowercase "a" into capital "A"
\032 = _ /* Translate space (decimal 032, &H20 too) into underscore
\027 = \032 /* Translate escape character to a space
Some leading characters in INI files are treated specially within Wayne
Software programs. INI lines that begin with any of the following characters
may lead to odd results: "[", "/", "&", "\", ";", ":", "<", and ",". To avoid
problems, use hexadecimal or decimal representations for these characters. For
example, use \047 or &H2F if you want to override the definition of "/".
READY.DOC 6 Jul 31, 1997
Specifying parameters:
Parameters for this program can be set in the following ways. The last setting
encountered always wins:
- Read from an *.INI file (see BRUCEINI.DOC file),
- Through the use of an environmental variable (SET READ=whatever), or
- From the command line (see "Syntax" below)
Note that the READY program allows you to provide the same parameters accepted
by the READ program. READY just ignores any parameters that it does not in
fact support. It even reads the READ.INI file by default.
Syntax:
READY [ filespec | /Tfilename ] [ /KEEP | /-KEEP ] [ /WIDTH=n ]
[ /TRUNCATE | /SPLIT | /WRAP ] [ /INDENT=n | /INDENT=-n | /INDENT=str ]
[ /H word [ word ]... ] [ /n | /n1-n2 | /n1+n2 | -n ] [ /LOAD ]
[ /FILTER | /FILTER=filename ] [ /BINARY | /EOL=str | /TEXT ]
[ /DATE | /-DATE ] [ /TIME | /-TIME ] [ /-DOS ] [ /PORT=port ]
[ /AFTERP=string ] [ /AFTERF=string ] [ /EGA | /VGA ]
[ /COLOR=nnn nnn nnn nnn nnn | /MONO ]
[ /Iinitfile | /-I ] [ /-ENV ] [ /? ] [ /?&H ] [ >filename ]
where:
"filespec" is the input file specification to be viewed. Can include wildcards
and full path information if desired. Note that either an input filespec or a
temporary file has to be provided; if neither is provided, you'll be prompted
for the file name to view. You can specify both if you'd like.
"/Tfilename" specifies the name of the temporary file. The file will contain
one 80-character record for each line in the source file plus one line which is
used to identify the input file. (If the line length is 132 or 255 characters,
the records will be that long instead.) The temporary file is stored by default
as C:\READY.TMP so "/TC:\READY.TMP" is the default value for this parameter.
Wildcards are not allowed for the temporary file name.
"/KEEP" says to keep the temporary file around after you leave the command. By
default, the temporary file is saved if a temporary file is explicitly
provided.
"/-KEEP" says to delete the temporary file no matter what.
"/WIDTH=n" specifies that the input file is presumed to have lines of length n
or less. Lines longer than n characters will be either truncated, wrapped, or
split (see settings below). READY will try to guess the line length for you
although it's quicker and more reliable if you enter it yourself. Normal
values are /WIDTH=80, /WIDTH=132, and /WIDTH=255. You cannot exceed a width of
255.
READY.DOC 7 Jul 31, 1997
"/TRUNCATE" says to truncate any line over the specified line length (for
example, any text after the 80th, 132nd, or 255th character are deleted). If
you print or copy the file from within READY, READY will write out the lines as
truncated, not in their original format.
"/SPLIT" says, for display purposes, to split any line over the specified line
length (for example, any line over 80, 132, or 255 characters). The
continuation lines are indicated by the /INDENT parameter. Line counts shown
will be the number of wrapped lines, not the original number of lines. See the
"/TRUNCATE" parameter above for additional caveats.
"/WRAP" says, for display purposes, to split any lines over the specified line
length (for example, any line over 80, 132, or 255 characters) on word
boundaries. READY will look for the last full word before the specified length
and wrap the line at that point. The continuation lines are trimmed of leading
spaces and are then indicated by the /INDENT parameter. "/WRAP" is initially
the default for this routine. See the "/TRUNCATE" and "/SPLIT" parameters
above for additional caveats.
"/INDENT=n" specifies that n-spaces are to be added to the start of each
continued line. Defaults to "/INDENT=3". If you don't want any indentation at
all, specify "/INDENT=0" or "/-INDENT".
"/INDENT=-n" specifies that n-spaces are to be added to the start of the first
(non-continued) line and nothing is to be added before the continued line. This
is primarily of use when "/BINARY" is specified.
"/INDENT=str" specifies that each continued line is to be started with the
specified string. The string cannot contain spaces (use /INDENT=n if you just
want spaces); however, you can embed decimal and hexadecimal strings (including
space representations) if desired (see BRUCEHEX.DOC file).
"/H word..." highlights up to 10 words throughout the text. Highlighting is
done on a word-by-word basis; not by phrase. So the words to highlight do not
have to appear together in the text to be found. You can also ask for or
change the words to be highlighted by using "H" within the program.
"/n" says to process lines beginning with line n. For example, "/1000" says to
read the file beginning with line 1000.
"/n1-n2" says to process lines n1 through n2. For example, "/500-700" will
process lines 500 to 700.
"/n1+n2" says to process n2 lines beginning with line n1. For example,
"/500+500" will process lines 500 to 999.
"/-n" (or "/+n") says to stop after processing the first n lines. For example,
"/+100" says to process only the first 100 lines of the file.
READY.DOC 8 Jul 31, 1997
"/LOAD" pre-loads the file into a temporary file (required) and then aborts to
DOS. This is so you can create the temporary files for something like network
access as part of a batch program so users won't have to spend time reloading
the file themselves. This option automatically invokes the "/KEEP" option.
"/FILTER" specifies that the program is to replace with spaces all
non-printable characters from the input file(s). This is primarily used in
conjunction with the "/BINARY" parameter. See the "Binary files" and "Defining
Character-Translations" discussions above. Initially defaults to "/-FILTER".
"/-FILTER" says to not bother removing the nonprintable characters from the
output. This is initially the default.
"/FILTER=filename" specifies that a filter is to be applied and all character
replacements are in the file "filename". See "Defining Character-Translations"
discussion above.
"/BINARY" says the input file is a binary file, like an EXE or a native word
processing document. This can be used as a way of seeing what the document
looks like and allowing you to rewrite it as a text file with reasonable
margins. See "Binary files" discussion above.
"/EOL=str" allows you to specify the end-of-line characters in your file. You
can embed decimal and hexadecimal strings (including space representations) if
desired (see BRUCEHEX.DOC file). This option is primarily of use when
processing binary files because, for standard text files, READY will correctly
determine the end-of-line characters (CR, LF, or CR/LF) for you. See "Binary
files" discussion above.
"/TEXT" confines any search to text files only. The program examines the first
thousand bytes of the file and skips any file that contains binary bytes
instead of exclusively text ones.
"/DATE" displays the file date and time on the status line; this is the
default.
"/-DATE" skips displaying the file date and time on the status line. If you
want to display the file time but not the date, specify /-DATE before /TIME.
"/TIME" displays the file time on the status line; this is the default.
Specifying "/-DATE" will turn off the time display by default.
"/-TIME" skips displaying the file time on the status line. Specifying "/DATE
will turn on the time display by default.
"/DOS" allows the user to say Alt-J to jump to DOS. This is initially the
default.
"/-DOS" prohibits jumping to DOS. Initially defaults to "/DOS".
READY.DOC 9 Jul 31, 1997
"/PORT=port" specifies the printer port to use for printing. This typically
defaults to /PORT=LPT1:.
"/AFTERP=string" specifies the string to print after a partial document is
printed. This string can include a page eject character ("\012") or any
printer reset codes ("\012\027E") you want. (See BRUCEHEX.DOC file.) Initially
defaults to "/AFTERP=\012".
"/AFTERF=string" specifies the string to print after a full document is
printed. See "/AFTERP=string" description. Defaults to "/AFTERF=\012".
"/EGA" or "/VGA" will put you in 43/50-line mode if your monitor supports this.
The two options are actually synonymous (you'll get the best your monitor
supports). You can also switch to and from 25-line and 43/50-line mode within
the program by using Alt-E.
"/COLOR=nnn nnn nnn nnn nnn" specifies the color settings to use for (in order)
(1) regular text, (2) the status line, (3) marked text, (4) found text, and (5)
highlighted words. Each setting must consist of three digits, the first two
being the foreground color and the last being the background color. The
foreground color should be padded on the left with a 0 if it is only one digit
in length. Defaults to "/COLOR=150 151 157 143 127". You can stop providing
numbers at any point after the first if you're willing to accept the default
colors.
Foreground colors:
Low intensity High intensity
0 = black 8 = dark grey
1 = blue 9 = light blue
2 = green 10 = light green
3 = cyan 11 = light cyan
4 = red 12 = light red
5 = magenta 13 = light magenta
6 = brown (or yellow) 14 = light yellow
7 = white 15 = bright white
Adding 16 to any color will make the text blink. Background colors can consist
of 0 to 7 above. Bright white on blue, for example, would be "151".
"/MONO" (or "/-COLOR") forces the system into monochrome mode.
"/COLOR" (or "/-MONO") forces the system into color mode. This is typically
the default.
READY.DOC 10 Jul 31, 1997
"/Iinitfile" says to read an initialization file with the file name "initfile".
The file specification *must* contain a period. Initfiles are described in the
BRUCEINI.DOC file. Initially defaults to "/IREAD.INI".
"/-I" (or "/INULL") says to skip loading the initialization file.
"/ENV" says to look for %var% occurrences in the command line and try to
resolve any apparent environmental variable references. See BRUCEINI.DOC for
more information. This is initially the default.
"/-ENV" says to skip resolving apparent %var% occurrences in the command line.
Initially defaults to "/ENV".
"/?" or "/HELP" shows you the syntax for the command.
"/?&H" gives you a hexadecimal and decimal conversion table.
">filename" redirects the output to a disk file. This automatically invokes
the /LOAD option, removes a lot of messages, does all that wrapping and such
for you, and displays the results to the screen as a long listing of text. This
is then rerouted to the text file so you have all of the effects without
suffering through an interactive routine. For example:
READY myfile /WIDTH=75 /WRAP /INDENT=0 > WRAPPED.X
This will process the file "myfile", wrapping long lines based on /WIDTH=75,
not indent the continuation lines, and save everything in a file named
WRAPPED.X.
READY.DOC 11 Jul 31, 1997
Viewing options:
While you're viewing a document with the READY command, you can use the
following keys. These are a subset of the commands available in the regular
READ command:
Cursor movement keys (up/down):
Up moves up one line
Down moves down one line
Home moves to the top line of the document
End moves to the bottom line of the document
PgUp moves up one screen's worth
PgDn moves down one screen's worth
Cursor movement keys (right/left):
Right moves one column to the right
Left moves one column to the left
Tab moves 8 columns to the right
Shift-Tab moves 8 columns to the left
Ctrl-Right moves to the far right of the document
Ctrl-Left moves to the far left of the document
Search for text:
\ or F or f or / search for text within the document
(the search is case-insensitive; "/COMMERCE" will find
"Commerce", "commerce", and "COMMERCE")
F3 search for the next occurrence of that text
F9 search for the previous occurrence of that text
H or h highlights up to 10 words throughout your text;
highlighting is done on a word-by-word basis, not by
phrase, so the words do not have appear near each other
to be highlighted (the search for text option, above, on
the other hand, looks for phrases, not words)
Marking lines:
Alt-M mark top line for copy or print
Alt-B mark bottom line for copy or print
Alt-U unmark all lines
Copying and printing lines (if lines are marked, the program copies/prints the
marked lines; if no lines are marked, the program copies/prints the entire
file):
Alt-C or Alt-D copy (duplicate) lines to a file
Alt-P print lines
Next/previous documents:
Ctrl-PgUp go to the previous file viewed
Ctrl-PgDn go to the next file specified on the input line
READY.DOC 12 Jul 31, 1997
Miscellaneous:
Alt-E toggles between 25-line and 43-/50-line mode (if your
system supports EGA and VGA respectively)
Alt-J or Alt-G jumps (goes) to DOS; say EXIT to get back to program;
this feature can be turned off using the /-DOS switch
Alt-R shows ruler at the top of the listing
Alt-N shows line numbers on the left side of the screen
F1 show key help screen
Esc leave READY program
Marking and copying/printing text:
If you need to copy/print a portion of your file, you will typically want to
mark sections of the text first. This is done using the mark functions: Alt-M
marks the top line on the screen and Alt-B marks the bottom line on the screen.
For example, you might decide that you have a 2,000-line document and you want
to print 50 lines of it. Go to the first line you want to print (you can use
the search options if you want to). Get that line at either the top of the
screen or the bottom of the screen. If it's the bottom line, press Alt-B; if
it's the top line, press Alt-M.
Now go to the last line you want to print. Again, get that line at either the
top of the screen or the bottom of the screen and press Alt-B or Alt-M
appropriately. Having marked two lines, the program tags those lines and all
those lines between them.
Now press Alt-P to print them. All marked lines will be printed.
Copying works similarly. Use Alt-C (or Alt-D) to copy the lines to a file.
Note that the program truncates or wraps any lines over the specified line
maximum (80, 132, or 255) and printing and copying with reflect this.
READY.DOC 13 Jul 31, 1997
Return codes:
READY returns the following ERRORLEVEL codes:
0 = no problems
2 = /LOAD operation carried out
249 = the last file read was not a text file
250 = escape pressed
254 = input file(s) not found
255 = syntax problems, or /? requested
Author:
Bruce Guthrie
Room H-4885
U.S. Dept of Commerce/ESA/STAT-USA
Washington, DC 20230
voice: (202) 482-3234
e-mail: bguthrie@doc.gov
You may freely copy and re-distribute this program; however, the U.S.
Department of Commerce neither guarantees nor assures compatibility of the
program with all computer software or hardware.
Additional information about this and other Bruce Guthrie programs can be found
in the file BRUCE.DOC which should be included in the original ZIP file. The
recent change history for this and the other programs is provided in the
HISTORY.ymm file which should be in the same ZIP file where "y" is replaced by
the last digit of the year and "mm" is the two digit month of the release;
HISTORY.611 came out in November 1996. This same naming convention is used in
naming the ZIP file (READymm.ZIP) that this program was included in.
Please provide an Internet e-mail address on all correspondence.